package org.pp.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.pp.admin.dto.SysMenuAdd;
import org.pp.admin.dto.SysMenuEdite;
import org.pp.core.PageBean;
import org.pp.core.Result;
import org.pp.dto.PageDto;
import org.pp.entity.SysMenu;
import org.pp.service.ISysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 权限（菜单） 前端控制器
 * </p>
 *
 * @author haima
 * @since 2024-04-16
 */
@RestController
@RequestMapping("/sysMenu")
@Tag(name = "Basecontroler学习")
public class BaseControllerTestController extends
        BaseCrudController<SysMenu,SysMenuAdd, SysMenuEdite,SysMenu>
implements BaseAdd<SysMenuAdd>,
        BaseEdite<SysMenuEdite>,
        BaseDetail<SysMenu>,
        BasePage<SysMenu>,
        BaseDelete
{
    @Autowired
    ISysMenuService sysMenuService;



    @GetMapping("/get")
    public String getMenu(){
        List<SysMenu> list = sysMenuService.list();
        return "OK";
    }

    @Override
    public Result<Object> add(SysMenuAdd dto) {
        return super.add(dto);
    }

    @Override
    public Result<Void> edite(SysMenuEdite dto) {
        return super.edite(dto);
    }

    @Override
    public Result<SysMenu> detail(Long id) {
        return super.detail(id);
    }

    @Override
    public Result<PageBean<SysMenu>> page(PageDto page) {
        return super.page(page);
    }

    @Override
    public Result<Void> delete(String ids) {
        return super.delete(ids);
    }
}